package com.asia5b.a5mall.order.adapter

import android.widget.LinearLayout
import android.widget.TextView
import com.asia5b.a5mall.middleware.widget.popup.PopupItemTextInterface
import com.asia5b.a5mall.order.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Created by zhangyuncai on 2020/5/17.
 */
class SelectAdapter<T:PopupItemTextInterface> (list: ArrayList<T>) :
        BaseQuickAdapter<T, BaseViewHolder>(R.layout.item_orderlist_type_adapter, list) {
    var selectPostion=-1
    override fun convert(helper: BaseViewHolder, item: T) {
        val ll_orderlist_typename_vessel = helper.getView<LinearLayout>(R.id.ll_orderlist_typename_vessel)
        val tv_orderlist_typename = helper.getView<TextView>(R.id.tv_orderlist_typename)
        ll_orderlist_typename_vessel.isSelected = (selectPostion === helper.layoutPosition)
        tv_orderlist_typename.text = item.text
    }

}